<!--
 * @Author: wwssaabb
 * @Date: 2021-09-09 09:59:13
 * @LastEditTime: 2021-09-09 11:52:30
 * @FilePath: \gshop-client\src\views\order.vue
-->
<template>
  <div class="navbar">
    <NavBar title="订单列表"></NavBar>
  </div>
  <div class="order">
    <div class="not-login">
      <img src="../assets/img/not-login.png" alt="" />
      <h3>登录之后查看外卖订单</h3>
      <Button type="primary" color="#02a774" round @click="toLogin"
        >立即登录</Button
      >
    </div>
  </div>
  <div class="tabbar">
    <Tabbar :active="2"></Tabbar>
  </div>
</template>

<script setup lang="ts">
import NavBar from "../components/Navbar.vue";
import Tabbar from "../components/Tabbar.vue";
import { Button } from "vant";
import { useRouter } from "vue-router";
//创建router实例
const router = useRouter();

//登录btn触发的函数，去往登录页面
const toLogin = () => router.push("/login");
</script>

<style lang="scss" scoped>
.order {
  position: relative;
  .not-login {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    img {
      width: 50vw;
      object-fit: cover;
    }

    h3 {
      font-size: 16px "Microsoft YaHei";
      color: #333;
    }

    button {
      height: 30px;
    }
  }
}
</style>
